package yto.freemarker.springaop.servlet;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.HandlesTypes;
import java.util.Set;

/**
 * servlet3.0的一个类实现了ServletContainerInitializer接口，就会调用start的方法
 *
 * @author dongxing
 **/
@HandlesTypes(MyInitializar.class)  //实现了WebApplicationInitializer接口的类
public class MyservletContainerInitializer implements ServletContainerInitializer {
    @Override
    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {

        /**
         * Set<Class<?>> set
         * set是WebApplicationInitializer所有的实现类
         */

        for (Class<?> aClass : set) {
            System.out.println(aClass.getName());
        }

    }
}
